//package com.csii.user.subscribe;
//
//import com.csii.core.constant.PublishAndSubscribeConstant;
//import com.csii.entity.SubscribeWrapper;
//import com.csii.service.PublishService;
//import com.csii.user.entity.SysUser;
//import com.csii.user.service.ISysUserService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.util.List;
//
//@Component
//public class UserInfoAllSyncTrigger implements SubscribeWrapper<String> {
//
//    private final String ALL = "ALL";
//
//    @Autowired
//    private PublishService publishService;
//
//    @Autowired
//    private ISysUserService sysUserService;
//
//    @Override
//    public String getSubscribeName() {
//        return PublishAndSubscribeConstant.USER_INFO_ALL_SYNC_TRIGGER;
//    }
//
//    @Override
//    public void receiveMessage(String key) {
//       List<SysUser> list = sysUserService.getUserListAndRole(null);
//        if (ALL.equals(key)){
//            publishService.publish(PublishAndSubscribeConstant.USER_INFO_ALL_SYNC,list,true);
//        }else{
//            publishService.publish(key,list,true);
//        }
//    }
//
//    @Override
//    public boolean isSubscribeNameMergeAppName() {
//        return false;
//    }
//}
